# with open("data.txt","w")as f:#w模式会清空原有文件内容，a模式可以附加内容。
#     f.write("Hello!\n")
#     f.write("yooo!")
with open("./poem.txt","w",encoding="utf-8") as f:
    f.write("我欲乘风归去,\n")
    f.write("又恐琼楼玉宇,\n")
    f.write("高处不胜寒.\n")#也可以都转移在一个括号里面，这样就只用调用一次write。
with open("./poem.txt","a",encoding="utf-8") as f:
    f.write("起舞弄清影，\n何似在人间。")